import request from '@/utils/request'

export default {

  getPageList(pageNum, pageSize, query) {
    return request({
      url: `/rule/list/${pageNum}/${pageSize}`,
      method: 'get',
      params: query
    })
  },

  updateState(obj) {
    return request({
      url: `/rule/updateState`,
      method: 'put',
      data: obj
    })
  },
  delRule(obj) {
    return request({
      url: `/rule/delete`,
      method: 'delete',
      data: obj
    })
  },
  getRuleEnum() {
    return request({
      url: `/rule/getRuleEnum`,
      method: 'get'
    })
  },
  getDeptRoleUser() {
    return request({
      url: `/rule/getDeptRoleUser`,
      method: 'get'
    })
  },
  addRule(obj) {
    return request({
      url: `/rule/addRule`,
      method: 'post',
      data: obj
    })
  },
  details(ruleId) {
    return request({
      url: `/rule/details/${ruleId}`,
      method: 'get'
    })
  },
  updateRule(obj) {
    return request({
      url: `/rule/updateRule`,
      method: 'post',
      data: obj
    })
  },
  appDetails(ruleId) {
    return request({
      url: `/rule/appDetails/${ruleId}`,
      method: 'get'
    })
  },
  getCompList() {
    return request({
      url: `/company/list`,
      method: 'get'
    })
  }
}
